package com.example.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 公告状态枚举
 */
@Getter
@AllArgsConstructor
public enum ClassroomStatusEnum {

    UNPUBLISH(0, "未发布"),
    SIGNING_UP(1, "报名中"),
    STARTED(2, "已开课"),
    DISCONTINUED(3, "已结业");

    private final Integer code;
    private final String desc;
    
    public static String getDescByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (ClassroomStatusEnum status : ClassroomStatusEnum.values()) {
            if (status.getCode().equals(code)) {
                return status.getDesc();
            }
        }
        return null;
    }
} 